package main

import (
	"sbd_nydjz/handler"
	"sbd_nydjz/inits"
	"sbd_nydjz/reposit"
	"sbd_nydjz/service"
)

var (
	GasterHandler  handler.GasterHandler
	TagViewHandler handler.TagViewHandler
	CompanyHandler handler.CompanyHandler

	// HostHandler ws.HostHandler
)

func init() {
	if err := inits.Init(""); err != nil {
		panic(err)
	}
	DB := inits.NewDatabase
	GasterHandler = handler.GasterHandler{
		GasterSrv: service.GasterService{
			Repo: reposit.GasterReposit{
				Db: DB(),
			},
		},
		CfInfoSrv: service.CfInfoService{
			Repo: reposit.CfInfoReposit{
				Db: DB(),
			},
		},
	}
	TagViewHandler = handler.TagViewHandler{
		TageViewSrv: service.TagViewService{
			Repo: reposit.TagViewReposit{
				Db: DB(),
			},
		},
		SyfwSrv: service.SyfwService{
			Repo: reposit.SyfwReposit{
				Db: DB(),
			},
		},
	}
	CompanyHandler = handler.CompanyHandler{
		CompanySrv: service.CompanyService{
			Repo: reposit.CompanyReposit{
				Db: DB(),
			},
		},
	}
}
